import java.util.Date;
/*
    FCB抽象
 */
public class FCB {
    private String fileName;
    //是否是文件、目录
    private boolean isFile;
    //多少句柄指向
    private int useCount;
    //创建者
    private Authority authority;
    //时间相关
    private Date createDate;
    private Date visitDate;
    private Date writeDate;
    //总大小
    private int size;
    //链接法磁盘
    private DiskBlock firstBlock;

    public Date getCreateDate() {
        return createDate;
    }

    public void setVisitDate(Date visitDate) {
        this.visitDate = visitDate;
    }

    public FCB(String fileName,boolean isFile,int size){
        this.fileName=fileName;
        this.createDate=new Date();
        this.isFile=isFile;
        this.firstBlock=new DiskBlock();
        size-=DiskBlock.size;
        DiskBlock nowDiskBlock = firstBlock;
        //链接分配文件
        while(size>DiskBlock.size){
            nowDiskBlock.setNextBlock(new DiskBlock());
            nowDiskBlock=nowDiskBlock.getNextBlock();
            size-=DiskBlock.size;
        }
    }
}
